package two;

import java.lang.reflect.Method;
import java.lang.reflect.Field;

public class TestPersonRefection {
    public static void main(String[] args) throws NoSuchMethodException, InstantiationException{
        Class<Person> person = two.Person.class;
        Method[] declaredMethods = person.getDeclaredMethods();
        for (Method method : declaredMethods) {
            System.out.println(method.getName());
        }
        System.out.println("------------------------------------------------");
        Method showNation = person.getDeclaredMethod("showNation");
        showNation.setAccessible(true);

    }
}
